<template>
  <div class="InterfaceShow-container">
    <van-json-viewer :json="jsonData"></van-json-viewer>
  </div>
</template>

<script lang="ts">
import { ComponentInternalInstance, defineComponent, getCurrentInstance, reactive } from 'vue'
// import { useStore } from "vuex";
import VanJsonViewer from '@/components/VanJsonViewer/index.vue'

export default defineComponent({
  name: 'InterfaceShow',
  components: {
    VanJsonViewer
  },
  props: {},
  setup() {
    // const store = useStore();
    const { proxy, appContext } = getCurrentInstance() as ComponentInternalInstance
    console.log(proxy, appContext)
    appContext.config.globalProperties.$connect('ws:172.16.6.171:3306')
    appContext.config.globalProperties.$socket.onmessage = (res: any) => {
      console.log(res)
    }
    const jsonData = reactive({ a: 1, b: { c: 2, d: 'aa' } })
    return {
      jsonData
    }
  }
})
</script>

<style lang="scss" scoped></style>
